package com.qf.j2102.service.impl;

import com.qf.j2102.mapper.DeptMapper;
import com.qf.j2102.po.Dept;
import com.qf.j2102.service.DeptService;
import com.sun.crypto.provider.DESParameters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    @Override
    public List<Dept> listall() {
        List<Dept> finddepts = deptMapper.finddepts();
        return finddepts;
    }

    @Override
    public Dept listone(int id) {
        Dept finddept = deptMapper.finddept(id);
        return finddept;
    }

    @Override
    public boolean add(Dept dept) {
        deptMapper.adddept(dept);
        return true;
    }

    @Override
    public boolean update(Dept dept) {
        deptMapper.updatedept(dept);
        return true;
    }

    @Override
    public boolean delete(int id) {
        deptMapper.deletedept(id);
        return true;
    }
}
